<template>
  <div v-if="isLogin" class="shopCar">
    <uv-alert title="" type="warning" description="温馨提示:如您购买的是保健食品，请注意:保健食品不是药物，不能代替药物治疗疾病"></uv-alert>
  <div @click="editShopCar" v-if="!editButtom&&shopData.length>0" class="edit">编辑 </div>
  <div @click="editShopCar2" v-if="editButtom" class="edit">取消编辑 </div>

  <div v-for="(i,index) in shopData" :key="index" v-if='shopData.length>0' class="content_shop_car">
<div class="header_title">
  <view @click="clickSeitonAll(i)">
  <view v-if="setionGou(i)"  class="gou">
    <uv-icon color="#fff" name="checkbox-mark"></uv-icon>
  </view>
 <view v-else class="no_gou"> </view>
</view>
 <view class="view_image">  
 <uv-image :lazy-load="true" src="/static/fz.png" width="24rpx" height="24rpx"></uv-image>
</view>
<view class="text_s">{{i.shopName}}</view>

</div>



<view v-for="(item,index) in i.shopList" :key="index" class="list_shop">
  <view @click="clickSetion(item)">
  <view v-if="setionGouFn(item)"  class="gou">
    <uv-icon color="#fff" name="checkbox-mark"></uv-icon>
  </view>
  
 <view v-else class="no_gou"> </view>
</view>
<view class="iamge_s">
  <image mode="heightFix" style="height: 
  144rpx;" :src="item.imgUrl" ></image>
</view>

<view  :key="index" class="content_box">
<view class="font_shop">{{ item.title }}</view>

<view class="tag_shop">{{ item.message || '无规格' }}</view>

<view class="price_box_shope">

  <view class="price">￥{{ item.price }}</view>
  <view class="numberbox">

    <uv-number-box  v-model="item.num">
		<template v-slot:minus>
			<view @click="valChange(item,-1)" class="minus">
       <!-- <uv-icon color="#fff" name="checkbox-mark"></uv-icon> -->
       <uv-icon name="minus" size="8">
				</uv-icon>
			</view>
		</template>
		<template v-slot:input>
			<text  style="width: 50px;text-align: center;font-size: 26rpx;" class="input">
				{{item.num}}
			</text>
		</template>
		<template v-slot:plus>
			<view @click="valChange(item,1)" class="plus">
				<uv-icon name="plus" color="#FFFFFF" size="8">
				</uv-icon>
			</view>
		</template>
	</uv-number-box>
  </view>
</view>
</view>
</view>

  </div>

  <div class="view_text_empty" v-else>

    <uv-empty text="购物车为空，去挑选商品吧" iconColor="#fff" mode="car" icon="https://cdn.uviewui.com/uview/empty/car.png"></uv-empty>

   <!-- <view class="view_button">
    <view class="button_item">去逛逛</view>
   </view> -->
  </div>

<view class="margin_bottom"></view>
<uv-divider  textSize="22rpx" text="为您推荐 猜您喜欢"></uv-divider>


<view class="list_goods">
          <view v-for="(item,index) in recommendListData"  :key="index" @click="gotoDetail(item)" class="item">
			<uv-image :lazy-load="true" :src="item.imgUrl"  mode='widthFix' width="100%" ></uv-image>
             <view class="item_title">
			
				<p class="span_p" style="text-align: left;font-size: 24rpx;">
					<view v-if="item.tips" class="nianhuo">
					{{ item.tips }}
				</view>
				<text>
					{{ item.goodsTitle }}
				</text>
					</p>
			 </view>

			 <view class="prive_title">

				<span class="price_red">￥{{ item.goodsPrice }} </span>

				<span class="price_scale">已售{{ index+ +item.prodId  }}件 </span>
			 </view>

			 <view style="display: none;" class="margin_top_bottom">
             <view class="box1">多人拼团</view>
			 <view class="box2">
              <view class="quan">券</view>
			  <view class="quan2">满100元减30</view>
			 </view>
			 </view>

			 <view class="shopmall"> {{ item.shopName }} 	<uv-icon name="arrow-right" color="#8D8D8D" size="12"></uv-icon></view>
		  </view>

		  

		</view>


    <view v-if="shopData.length>0" class="cardFix">
<view @click="changeGou(shopData)" class="gou_card ">

  <view v-if="AllGou"  class="gou">
    <uv-icon color="#fff"  name="checkbox-mark"></uv-icon>
  </view>
 <view  v-else class="no_gou"> </view>
 <span  class="ss">全选</span>
</view>

<view v-if="!editButtom" class="right_card">
  <view class="price">
    <view class="price_text">
      合计：<view class="red">￥{{totalNumFn()}}</view>
    </view>
    <view class="noContent">不含运费和优惠</view>
  </view>

  <view @click="gotoPay()" class="total">结算（{{totalPrice()}}）</view>
</view>

<view v-if="editButtom" class="right_card">
  

  <view @click="delAllGoods" class="total_del">删除商品</view>
</view>
    </view>
  </div>

  <div class="view_text_empty" v-else>

<uv-empty text="暂未登录，无法查看购物车" iconColor="#fff" mode="car" icon="https://cdn.uviewui.com/uview/empty/car.png"></uv-empty>





</div>

<uv-popup ref="popupBuy" round="20">
			<view style="padding: 20rpx;">
			 <view style="display: flex;align-items: center;justify-content: center;margin-bottom: 
       50rpx;font-weight: bold;font-size: 28rpx;">
         购物须知
      </view>
      <view style="font-size: 24rpx;"> 
        &nbsp;&nbsp;&nbsp;&nbsp;尊敬的会员朋友，购物前请仔细阅读以下内容，以免产生错误购买。
        详情请仔细查阅以下：
        <span @click="check1"  style="color: red;">《购卡须知》</span>
        <span @click="check1" style="color: red;">《排队返利须知须知》</span>
      </view>

      <view style="display: flex;align-items: center;justify-content: space-between;margin-top: 50rpx;">
            
    
        <uv-button @click="NOOK" customTextStyle="font-size:22rpx;width:200rpx" type="error" shape="circle" :plain="true" :hairline="true" text="取消"></uv-button>
        <uv-button @click="OK" customTextStyle="font-size:22rpx;width:400rpx" type="error" shape="circle" text="已知晓并继续"></uv-button>
      </view>
			</view>
		</uv-popup>


    <uv-popup ref="popupCheck1">
      <view style="padding: 20rpx">
        <scroll-view style="height: 80vh" :scroll-y="true">
          <uv-parse :content="checkContent"></uv-parse>
        </scroll-view>
      </view>
    </uv-popup>
</template>

<script setup>
import { ref ,watch} from "vue";
import {getShopCar,changeItem,totalPay,deleteItem,confirm} from '../../src/https/api/shopCar'
import { onShow } from "@dcloudio/uni-app";
import {getTodayGrab} from '../https/api/index'

let popupBuy = ref(null)
let popupCheck1 = ref(null)
let getgetShopCarData = async(data) => {
let res = await getShopCar(data)
if(res){
  shopData.value = res.data.map(v=>{
    return {
      shopName:v.shopName,
      shopId:v.shopId,
      shopList: v.shopCartItemDiscounts[0].shopCartItems.map(item=>{
        return {
          ...item,
          check: false,
          imgUrl:item.pic,
          title:item.prodName,
          num:item.prodCount,
          price:item.price,
          message:item.skuName
        }
      })
    }
  })
}
}

let checkContent = ref('')
let check1 = () =>{
  popupCheck1.value.open('bottom')
  checkContent.value = `<div class="WordSection1" style="layout-grid:15.6pt">

<p class="MsoNormal" align="center" style="text-align:center;line-height:22.0pt;
mso-line-height-rule:exactly"><b><span lang="ZH-CN" style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">购卡须知</span></b><b><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:
&quot;Microsoft YaHei&quot;"><o:p></o:p></span></b></p>

<p class="MsoNormal" style="line-height:22.0pt;mso-line-height-rule:exactly"><span lang="ZH-CN" style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;
mso-bidi-font-family:&quot;Microsoft YaHei&quot;">会员资格</span><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:
&quot;Microsoft YaHei&quot;">:<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">1<span lang="ZH-CN">、对会员的入会资格评定权归国景（西京）游泳馆所有</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">2<span lang="ZH-CN">、符合本游泳馆部的各项章程并且办理会员卡后，方可取得国景（西京）游泳馆会员资格</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">3<span lang="ZH-CN">、会员卡是证明会员资格的凭证，仅供本人使用，不得私自转让</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">4<span lang="ZH-CN">、本游泳馆会员须年满</span>8<span lang="ZH-CN">周岁</span>(<span lang="ZH-CN">身高</span>1.2<span lang="ZH-CN">米以上</span>)<span lang="ZH-CN">不满</span>65<span lang="ZH-CN">周岁且身体健康，儿童游泳须有家人陪护。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height:22.0pt;mso-line-height-rule:exactly"><span lang="ZH-CN" style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;
mso-bidi-font-family:&quot;Microsoft YaHei&quot;">一、总纲</span><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:
&quot;Microsoft YaHei&quot;">:<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">1<span lang="ZH-CN">、会员卡自办卡日起</span>3<span lang="ZH-CN">个月之内开卡</span>(<span lang="ZH-CN">特惠卡除外</span>),<span lang="ZH-CN">过期未开卡视为作废。会员卡自开卡日之起有效期一年</span>(<span lang="ZH-CN">特惠卡除外</span>)<span lang="ZH-CN">，过期失效。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">2<span lang="ZH-CN">、会员卡一经售出，概不退换。会员卡如有遗失或被盗，需及时补办，本俱乐部管理处将收取</span>30<span lang="ZH-CN">元的补办卡费，</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">3<span lang="ZH-CN">、年卡类会员必须是本人，并出示会员卡才能进入游泳馆</span>;<span lang="ZH-CN">如果忘记携带，应凭借会员卡号和本人身份证进入俱乐部。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">4<span lang="ZH-CN">、游泳馆的营业时间为</span>:9:00-21:00<span lang="ZH-CN">。每周一、周五 早上为</span>10:00<span lang="ZH-CN">营业。本馆有权根据特殊需要适当调整营业时间并店内公示。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height:22.0pt;mso-line-height-rule:exactly"><span lang="ZH-CN" style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;
mso-bidi-font-family:&quot;Microsoft YaHei&quot;">二、会员权利</span><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:
&quot;Microsoft YaHei&quot;">:<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">1<span lang="ZH-CN">、报停</span>:<span lang="ZH-CN">会员因个人原因不能正常参加游泳，会员可申请报停，每张会员卡享有最多三次报停的权利，报停时间累计最长三个月。报停必须以书面形式提前办理并取得本馆管理处同意方可生效</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">2<span lang="ZH-CN">、女会员如在会员期限内怀孕凭借县级以上医院证明，可给予办理会员卡报停手续，报停时间最长不超过十二个月。报停必须以书面形式提前办理并取得本馆管理处同意方可生效</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">3<span lang="ZH-CN">、为答谢会员长期以来对本游泳馆的支持，会员生日当天凭借有效会员卡可领取游泳票两张</span>;<span style="mso-tab-count:1">&nbsp;&nbsp; </span>:<span lang="ZH-CN">坚类斗员会</span><span style="mso-tab-count:1"> </span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">4<span lang="ZH-CN">、针对本游泳馆的服务，会员有提出批评、投诉及改进建议的权利</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height:22.0pt;mso-line-height-rule:exactly"><span lang="ZH-CN" style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;
mso-bidi-font-family:&quot;Microsoft YaHei&quot;">三、会员义务</span><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:
&quot;Microsoft YaHei&quot;">:<span style="mso-tab-count:2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">1<span lang="ZH-CN">、如实向游泳馆前台提供个人信息资料。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">2<span lang="ZH-CN">、严禁心肺功能疾病、皮肤病、传染病、高血压患者进入本游泳馆，有以上疾病的患者隐瞒病情取得会员资格的，本游泳馆有权终止其会员资格，并保留追究其法律权利。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">3<span lang="ZH-CN">、会员严禁携带</span>1.2<span lang="ZH-CN">米以下儿童进入游泳区域，对于擅自进入游泳区域造成伤害的，本游泳馆概不负责</span>.<span lang="ZH-CN">赫</span>):<span lang="ZH-CN">主备</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">4<span lang="ZH-CN">、严禁在本游泳馆吸烟、进食。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">5<span lang="ZH-CN">、严禁携带宠物进入本游泳馆。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">6<span lang="ZH-CN">、严禁在本游泳馆内大声喧哗，使用污秽语言以及一切违法活动。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">7<span lang="ZH-CN">、本游泳馆不接受</span>65<span lang="ZH-CN">岁以上老人入会，能出具真实有效的健康证明且签订免责申明者除外，但因隐瞒或错报个人年龄、健康等信息，而发生的一切责任都由其本人承担。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height:22.0pt;mso-line-height-rule:exactly"><span lang="ZH-CN" style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;
mso-bidi-font-family:&quot;Microsoft YaHei&quot;">四、免责条款</span><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:
&quot;Microsoft YaHei&quot;"><span style="mso-tab-count:1">&nbsp;&nbsp; </span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">1<span lang="ZH-CN">、遇不可抗力</span>(<span lang="ZH-CN">如战争、自然灾害等</span>)<span lang="ZH-CN">造成本游泳馆营业终止或会员会籍不能继续，致使会员遭受损失，本馆不予承担任何责任</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">2<span lang="ZH-CN">、会员所受损害是因其自身故意或过失造成的，本馆不予承担任何责任</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">3<span lang="ZH-CN">、会员所受损害是本游泳馆工作人员以外的任何第三方故意或过失行为导致的，本馆不予承担任何责任</span>,<span lang="ZH-CN">金员会</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">4<span lang="ZH-CN">、受害方严重违反本馆制定的规章制度所造成的损害，本馆不予承担任何责任</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">5<span lang="ZH-CN">、未交由本游泳馆保管</span>,<span lang="ZH-CN">而由会员或会员随同人员个人保管的贵重物品发生毁损、遗失的，本馆不予承担任何责任</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">6<span lang="ZH-CN">、因会员资料或个人信息发生变动未及时通知本馆，从而造成损失或会员权利受限的，本馆不予承担任何责任</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">7<span lang="ZH-CN">、未听从本游泳馆工作人员指导，擅自跳水、戏水造成自身受伤，及他人受伤的，其本人应承担全部赔偿责任，对此本游泳馆不承担任何责任</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">8<span lang="ZH-CN">、因会员自身行为不当或会员之间的争议产生的人身和财产损失，本游泳馆不承担责任</span>;<span lang="ZH-CN">新圆劲青申本</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">9<span lang="ZH-CN">、会员未及时告知自身患有或隐瞒重大疾病病症或病史发生意外时，对此本游泳馆不承担任何责任</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">10<span lang="ZH-CN">、会员饮酒、吸毒或使用其他违禁药品后发生意外时，对此本游泳馆不承担任何责任。人衣盖后公长</span><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height:22.0pt;mso-line-height-rule:exactly"><span lang="ZH-CN" style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;
mso-bidi-font-family:&quot;Microsoft YaHei&quot;">五、安全提示</span><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:
&quot;Microsoft YaHei&quot;"><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">1<span lang="ZH-CN">、会员在游泳前</span>,<span lang="ZH-CN">先冲淋再做必要的热身练习再下水</span>,<span lang="ZH-CN">本游泳馆禁止跳水</span>,<span lang="ZH-CN">以免受伤。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">2<span lang="ZH-CN">、过度游泳及违规游泳均有受伤的可能，所以您在运动前应对自己的身体情况进行判断，并保持运动强度和时间的适当。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height:22.0pt;mso-line-height-rule:exactly"><span lang="ZH-CN" style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;
mso-bidi-font-family:&quot;Microsoft YaHei&quot;">六、会员承诺</span><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:
&quot;Microsoft YaHei&quot;"><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">1<span lang="ZH-CN">、本人保证所提供的入会资料及个人信息真实有效</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">2<span lang="ZH-CN">、本人身体健康且没有本协议约定的不适合进行运动的疾病</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">3<span lang="ZH-CN">、本人已阅读、理解并同意上述条文。</span><o:p></o:p></span></p>

</div>
  `
}

let NOOK = () => {

  popupBuy.value.close()
}

let OK = () => {
  popupBuy.value.close()
  console.log(totalComArr.value)
  if(totalComArr.value.length == 0){
    uni.showToast({
      title:'请选择商品',
      icon:'none'
    })
    return 
  }else {
    let obj = {
      addrId:0,
      basketIds:totalComArr.value,
      couponIds:[],
      userChangeCoupon:1

    }


    uni.setStorageSync('orderInfoDetail',JSON.stringify(obj))
    uni.navigateTo({
      url:'/pages/settlement'
    })
  }
}


let gotoPay = async() => {
  popupBuy.value.open('bottom')
  
}


let valChange = async(item,val) => {
  
  if(val>0&&item.num >=1){
    let res = await changeItem({"count":val,"prodId":item.prodId,"skuId":item.skuId,"shopId":item.shopId})
  if(res.msg !=='ok'){
    item.num --
    uni.showToast({
      title:res.msg,
      icon:'none'
    })
  }
  totalArrPay(totalComArr.value)
  }else if(val<0&&item.num ==1){
    
  }
  
}

let totalArr = ref([])
let totalArrPay = async(arr) => {
  let res = await totalPay(arr)
  console.log(res)
}

let totalComArr = ref([])
watch(totalArr,()=>{
  let totalArrS = []
  shopData.value.forEach(v=>{
  
    totalArrS = totalArrS.concat(v.shopList.filter(item=>item.check))
  })
  console.log(totalArrS)

  totalComArr.value = totalArrS.map(v=>v.basketId)

 totalArrPay(totalComArr.value)
},{deep:true})


let recommendListData = ref([])
let getrecommendList = async(data) => {
  let res = await getTodayGrab(data)
  if(res){
	recommendListData.value = res.data.records.map(v=>{
		return {
			...v,
			imgUrl:v.pic,
			goodsPrice:v.price,
			goodsTitle:v.prodName,
		}
		
	})
  }
}

let gotoDetail = (item) => {
  uni.setStorageSync('goodsDetailData',JSON.stringify(item))
	uni.navigateTo({
		url: '/pages/goodsDetail'
	})
}


let isLogin = ref(false)
onShow(()=>{

  if(uni.getStorageSync('userInfo')){
    isLogin.value = true
    getrecommendList({tagId: 5,
size: 6})
  getgetShopCarData({})
  }else{
    isLogin.value = false
  }


 
})



let delAllGoods =async () => {

  if(totalComArr.value.length > 0){
    uni.showModal({
    title: '提示',
    content: '确定删除商品吗？',
    success: async(res) => {
      if (res.confirm) {
      
        await deleteItem(totalComArr.value)
        getgetShopCarData({})
        totalArrPay(totalComArr.value)
      } 
    }
  })
  }else{
    uni.showToast({
      title:'请选择要删除的商品',
      icon:'none'
    
    })
  }


}



let editButtom = ref(false)
let editShopCar = ()=>{
  editButtom.value = true
}
let editShopCar2 = ()=>{
  editButtom.value = false
}

let clickSetion = (item) => {
  item.check = !item.check;
  totalArr.value.push(item.basketId)
}

let setionGouFn = (item) => {
   return item.check
}

let clickSeitonAll = (data) => {
  
 
  setionBool.value = data.shopList.every(item=>item.check)
  if (data) {
    
    data.shopList.forEach(item => {
      item.check = !setionBool.value 
      
      totalArr.value.push(item.basketId)
    })
    
  }
}

let setionBool = ref(true)
let setionGou = (data)=>{
  

  
  return data.shopList.every(item=>item.check)
}

let changeNum = (num,price,item) => {
  
  // price = num * price
}

let AllGou = ref(true)
let changeGou = (data) => {
  AllGou.value = !AllGou.value
  let priceList = []
data.forEach(element => {
  priceList =  priceList.concat(element.shopList)
});

priceList.forEach(item => {
  item.check = AllGou.value
  
  totalArr.value.push(item.basketId)
})



}


let totalPrice = () => {
  let data = shopData.value
let priceList = []
data.forEach(element => {
  priceList =  priceList.concat(element.shopList)
});
AllGou.value = priceList.every(item=>item.check)

let list = priceList.filter(item=>item.check)
return list.length
}

let totalNumFn = () => {
 let data = shopData.value
let priceList = []
data.forEach(element => {
  priceList =  priceList.concat(element.shopList)
});
AllGou.value = priceList.every(item=>item.check)

let list = priceList.filter(item=>item.check)

if(list.length>=2){
  let total = 0
  list.forEach(item=>{
    total+= item.price * item.num
  })
  return total
}else if(list.length == 1){
  return (list[0].price*list[0].num).toFixed(2)
}else{
  return 0
}


}



let shopData = ref([{
  shopName:'圣罗兰口红官方旗舰店',
  shopList:[
    {
      check:false,
      imgUrl:'xxxxx',
      title:'圣罗兰口红官方旗舰店圣罗兰口红官方旗舰店',
      num:10,
      price:12,
      message:'三套',
    },
    {
      check:true,
      imgUrl:'xxxxx',
      title:'圣罗兰口红官方旗舰店圣罗兰口红官方旗舰店',
      num:10,
      price:12,
      message:'三套',
    }
  ]
}
,
{
  shopName:'圣罗兰口红官方旗舰店',
  shopList:[
    {
      check:true,
      imgUrl:'xxxxx',
      title:'圣罗兰口红官方旗舰店圣罗2兰口红官方旗舰店',
      num:1,
      price:1221,
      message:'三套',
    },
    
  ]
}

])
</script>

<style scoped lang="scss">
.total_del{
  border-radius: 50rpx;
  padding: 15rpx 30rpx;
  border: 1px solid #848484;
  color: #848484;
  font-size: 26rpx;

}
.right_card{
  display: flex;
  align-items: center;
  .total{
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 20rpx;
    border-radius: 55rpx;
    background-image: linear-gradient(45deg, #FE3B30, #FF5951 100%);
    padding: 15rpx 30rpx;
    color: white;
    font-size: 26rpx;
  }
  .price{
   .noContent{
    color: #717171;
    font-size: 24rpx;
   }
    
    .price_text{
      display: flex;
    align-items: center;
      font-size: 30rpx;
    }
   .red{
    color: #FF1C23;
   
   }
  }
}
.cardFix{
  .gou_card{
   display: flex;
   align-items: center;
   font-size: 
              24rpx
            ;
            .ss{
              margin-left: 10rpx;
            }
  }
  background: white;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20rpx;
  .gou{
    display: flex;
    align-items: center;

    justify-content: 
    center;
    width: 36rpx;
    height: 36rpx;
    border-radius: 50%;
  
    background: #FF1C23;
  }
  .no_gou{
    width: 36rpx;
    height: 36rpx;
    border-radius: 50%;
    border: 1px solid #ccc;
  }
}
.list_goods{
  padding: 20rpx;
	.prive_title{
		margin-top: 8rpx;
		padding: 0 15rpx;
	}
	.shopmall{
    margin-top: 10rpx;
		display: flex;
  color: #8D8D8D;
  font-size: 22rpx;
  margin-bottom: 20rpx;
  padding: 0 15rpx;
	}
	.margin_top_bottom{
		padding: 0 15rpx;
		margin-bottom: 8rpx;
		margin-top: 6rpx;
		display: flex;
		align-items: center;
		flex-wrap: wrap;
		.box1{
			margin-right: 20rpx;
			border: 1px solid #FF1C23;
			width: 85rpx;
			height: 30rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			color: #DF0024;
			font-size: 18rpx;
		}
.box2{
	display: flex;
	align-items: center;
	margin-right: 20rpx;
}
	  .quan{
		padding: 1rpx;
		border: 1px solid #FF1C23;
		border-right: 1px dashed #FF1C23;
		color: #DF0024;
		font-size: 18rpx;
	  }
	  .quan2{
		padding: 1rpx;
		border: 1px solid #FF1C23;
		border-left: none;
		color: #DF0024;
		font-size: 18rpx;
	  }

	

	}
	.price_red{
		color: #FF1C23;
		font-size: 31rpx;
	}
	.price_scale{
		margin-left: 20rpx;
		color:#8D8D8D;
		font-size:22rpx;
	}
	margin-top: 20rpx;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	.item{
		margin-bottom: 20rpx;
		width: 49%;
     border-radius: 15rpx;
	 background: white;
	 .item_title{
		font-size: 25rpx;
		padding: 0 15rpx;
		margin-top: 15rpx;
		
		align-items: center;
	}
	.span_p{
		overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;  // 控制多行的行数
    -webkit-box-orient: vertical;


	}
	.nianhuo{
		display: inline-block;;
		border-radius: 10rpx;
		vertical-align: top;
		font-size: 20rpx;
		background-image: linear-gradient(135deg, rgb(246, 175, 175), red);
		width: 54rpx;
		height: 28rpx;
		text-align: center;
		color: white;
		font-weight: bolder;
		line-height: 28rpx;
       display: inline-block;
	}
	}
	
}
.price_box_shope{
  display: flex;
  align-items: center;
  justify-content: space-between;
  .price{
    color: #FF1C23;
    font-size: 30rpx;
  }

  .minus {
		width: 22px;
		height: 22px;
		border-width: 1px;
		border-color: #E6E6E6;
		border-style: solid;
		border-top-left-radius: 100px;
		border-top-right-radius: 100px;
		border-bottom-left-radius: 100px;
		border-bottom-right-radius: 100px;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		justify-content: center;
		align-items: center;
	}
	.input {
		padding: 0 10px;
	}
	.plus {
		width: 22px;
		height: 22px;
		background-color: #fa7a7e;
		border-radius: 50%;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		justify-content: center;
		align-items: center;
	}
}
.tag_shop{
  margin: 15rpx 0;
  border-radius: 50rpx;
  display: inline-block;
  color: #818181;
  font-size: 20rpx;
  padding: 7rpx 15rpx;
  background: #eee;
 
}
.font_shop{
  overflow: hidden !important;
		text-overflow: ellipsis !important;
		display: -webkit-box !important;
		-webkit-line-clamp: 1;//文字上限行
		-webkit-box-orient: vertical;

  font-size: 24rpx;
}
.content_box{
  width: 100%;
  margin-left: 20rpx;
}
.iamge_s{
  margin-left: 30rpx;
}
.list_shop{
  padding: 20rpx;
display: flex;
align-items: center;
}
.view_button{
  margin-top: 30rpx;
  display: flex;
  align-items: center;
  justify-content: center;
  .button_item{
    border: 1px  solid #FF2F2F;
    font-size: 22rpx;
     padding:15rpx 20rpx;
    border-radius: 15rpx;
    background: white;
    color: #FF2F2F;
    display: flex;
  align-items: center;
  justify-content: center;
  }
}
.view_text_empty{
  padding-bottom:80rpx ;
}
.text_s{
  margin-left: 10rpx;
  font-size: 
              24rpx
            ;
}
.view_image{
  margin-left: 20rpx;
}
.content_shop_car{
  margin: 20rpx;
  padding: 15rpx;
  border-radius: 15rpx;
  background: white;
  .header_title{
    padding-bottom: 15rpx;
    border-bottom: 1px solid #eee;
     display: flex;
     align-items: center;
  }
  .gou{
    display: flex;
    align-items: center;

    justify-content: 
    center;
    width: 29rpx;
    height: 29rpx;
    border-radius: 50%;
  
    background: #FF1C23;
  }
  .no_gou{
    width: 29rpx;
    height: 29rpx;
    border-radius: 50%;
    border: 1px solid #ccc;
  }
}
.shopCar{
  position: relative;
 padding-bottom: 120rpx;
 background: #F5F6F8;
}

.edit{
  padding: 15rpx 20rpx;
  background: white;
  font-size: 
              26rpx
            ;
            display: flex;
            justify-content: flex-end;
}

</style>